﻿<phone:PhoneApplicationPage 
    x:Class="GrimorioApplication.Views.ViewRecipeDetails"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!-- DEFINIZIONE DEGLI ELEMENTI DELLA LISTA DI INGREDIENTI-->
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="IngredientList">
            <StackPanel Orientation="Horizontal">
                    <TextBlock Foreground="OrangeRed" Text="{Binding Path=ingredientQuantity}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" FontSize="40" Margin="10,0" />
                    <TextBlock Text="{Binding Path=ingredientName}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" FontSize="32"/>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="GRIMORIO">
            <!--Pivot item one-->
            <controls:PivotItem Header="{Binding LocalizedResources.item1_add_receipe, Source={StaticResource LocalizedStrings}}">
                <ScrollViewer>
                    <StackPanel Orientation="Vertical">
                        <Grid Name="mygrid">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".7*"/>
                                <ColumnDefinition Width=".3*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="60"/>
                            </Grid.RowDefinitions>
                            <!--<TextBlock x:Name="label_receipePhoto" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Text="{Binding LocalizedResources.label_receipePhoto, Source={StaticResource LocalizedStrings}}" FontSize="36" />-->
                            <Image x:Name="recipePhoto" Visibility="Visible" Grid.Column="0" Grid.Row="1" Height="200" Width="auto"  Source="/Img/Grimorio_62_62_gray-01.png" />
                            <toolkit:Rating x:Name="ratingStars"  Grid.Column="0" Grid.Row="2" HorizontalAlignment="Center"  ReadOnly="True"/>

                            <Image Source="/Img/AppIcons/vegetarianIco_100_100.png" x:Name="recipeVegetarian" Visibility="Collapsed" Grid.Column="1" Grid.Row="2" Height="50" Width="auto"/>
                            <Grid Grid.Column="1" Grid.Row="1">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height=".5*"/>
                                    <RowDefinition Height=".4*"/>
                                </Grid.RowDefinitions>
                                <!-- Image for people -->
                                <TextBlock x:Name="numberOfPeopleContent" Grid.Row="0" Text="0" FontSize="70" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                <Image HorizontalAlignment="Center" x:Name="UserIconImage" Height="60" Width="auto" VerticalAlignment="Top" Source="/Img/AppIcons/user_100_100.png" Grid.Row="1"/>
                            </Grid>
                        </Grid>

                        <TextBlock x:Name="label_recipeNameContent" Foreground="OrangeRed" FontSize="36" />

                        <TextBlock x:Name="label_receipeDescription" Text="{Binding LocalizedResources.label_receipeDescription, Source={StaticResource LocalizedStrings}}" FontSize="36" />
                        <TextBlock x:Name="recipeDescriptionContent"/>
                        <TextBlock x:Name="label_recipeDish" Text="{Binding LocalizedResources.label_recipeDish, Source={StaticResource LocalizedStrings}}" FontSize="36" />
                        <TextBlock x:Name="recipeDishContent" />
                        
                        <TextBlock x:Name="label_receipeDifficulty" Text="{Binding LocalizedResources.label_receipeDifficulty, Source={StaticResource LocalizedStrings}}" FontSize="36" />
                        <TextBlock x:Name="recipeDifficultyContent"/>
                        
                        <TextBlock x:Name="label_receipeTime" Text="{Binding LocalizedResources.label_receipeTime, Source={StaticResource LocalizedStrings}}" FontSize="36" />
                        <TextBlock x:Name="recipeTimeContent"/>
                        
                        <TextBlock x:Name="label_receipeMatchings" Text="{Binding LocalizedResources.label_receipeMatchings, Source={StaticResource LocalizedStrings}}" FontSize="36" />
                        <TextBlock x:Name="recipeMatchingsContent"/>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="{Binding LocalizedResources.item2_add_receipe, Source={StaticResource LocalizedStrings}}">
                <toolkit:LongListSelector IsFlatList="True" x:Name="IgredientsList"  Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" ItemTemplate="{StaticResource IngredientList}">
                </toolkit:LongListSelector>
            </controls:PivotItem>

    <!--Pivot item three-->
            <controls:PivotItem Header="{Binding LocalizedResources.item3_add_receipe, Source={StaticResource LocalizedStrings}}">
                <Grid>
                    <ScrollViewer>
                        <TextBlock ScrollViewer.VerticalScrollBarVisibility="Visible" x:Name="recipePreparation" MinHeight="400" TextWrapping="Wrap" TextAlignment="Left" />
                    </ScrollViewer>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>
</phone:PhoneApplicationPage>